#!/usr/bin/env python


import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dalton import Filter, TestRun

test = TestRun(__file__, sys.argv)

f = Filter()

#enedft
f.add(string = 'Final HF energy',
      rel_tolerance = 1.0e-9)

#qm3convergence
f.add(from_string = 'QM/MM "QMMM" calculation converged',
      num_lines = 9,
      rel_tolerance = 1.0e-8)

#dipole
f.add(from_string = 'Dipole moment',
      num_lines = 5,
      mask = [1],
      rel_tolerance = 1.0e-5)

#dipcompx
#dipcompy
#dipcompz
f.add(from_string = 'Dipole moment components',
      num_lines = 8,
      rel_tolerance = 1.0e-6)

#excita
f.add(from_string = 'Singlet electronic excitation energies',
      num_lines = 10,
      rel_tolerance = 1.0e-6)

test.run(['qmmm1_short.dal'], ['CH2O_STO-3G.mol'], f={'out': f}, args='-put POTENTIAL.INP')

sys.exit(test.return_code)


#
